package com.guigu.youxuan.controller;

import com.guigu.youxuan.common.vo.OrderDetailsByMidVo;
import com.guigu.youxuan.pojo.GoodsInfo;
import com.guigu.youxuan.pojo.OrderDetails;
import com.guigu.youxuan.pojo.OrderInfo;
import com.guigu.youxuan.service.IOrderDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liweixin
 * @since 2024-05-15
 */
@CrossOrigin
@RestController
@RequestMapping("/orderDetails")
public class OrderDetailsController {
    @Autowired
    private IOrderDetailsService iOrderDetailsService;

    /**
     * 商户管理订单待收货---订单详情数据
     * @param
     * @return
     */
    @RequestMapping("/OrderDate/{id}")
    @ResponseBody
    public List<OrderDetails> OrderDate(@PathVariable int id){

        List<OrderDetails> list=iOrderDetailsService.OrderDate(id);
        return list;
    }
    /**
     * 根据商户id和订单创建时间查询订单明细
     * @param vo
     * @return
     */
    @RequestMapping("/queryOrderDetailsByMid")
    @ResponseBody
    private List<OrderDetails> queryOrderDetailsByMid(@RequestBody OrderDetailsByMidVo vo) {
        List<OrderDetails> orderDetailsList = iOrderDetailsService.queryOrderDetailsByMid(vo);
        return orderDetailsList;
    }
}
